package net.cyndeline.scalarlib.rldrawing

import net.cyndeline.scalarlib.rlgraph.planarGraphDrawing.rectangular.OuterFaceSelection
import scalax.collection.GraphEdge.UnDiEdge

/**
 * User-specified settings for generating rectangular duals.
 */
class FloorPlanSettings[V, E[X] <: UnDiEdge[X]] {
  private var outerFaceSelect: Option[OuterFaceSelection[V, E]] = None

  /** The maximum value of width/height and height/width that the segment heuristic should allow when optimizing the
    * initial layout. No area will have its size increased if doing so breaks this ratio. A higher ratio enables
    * better optimization in terms of target areas, but may result in disproportionate rectangles.
    */
  var maxAspectRatio: Double = 3

  /** Vertices whose areas should not be optimized by size or aspect ratio. */
  var heuristicExceptions = Set[V]()

  /** The smallest size allowed for each rectangle in the drawing. Example: Setting this to 3 will make every
    * rectangle be of size 3x3 or higher. heuristicExceptions are not affected by this.
    */
  var minimumSideSize: Int = 1

  def outerFaceSelection_=(s: OuterFaceSelection[V, E]): Unit = { outerFaceSelect = Some(s) }
  def outerFaceSelection: Option[OuterFaceSelection[V, E]] = outerFaceSelect
}
